home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9129 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: news.ptd.net!news
  2. From: onyx@postoffice.ptd.net (Matt Ayres)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Why is Gets() so bad?
  5. Date: 6 Mar 1996 23:33:45 GMT
  6. Organization: Neutron
  7. Message-ID: <4hl7cp$m84@ns2.ptd.net>
  8. References: <4hb1ie$pa7@ixnews2.ix.netcom.com> <4hdvuv$3vr@gryphon.phoenix.net>
  9. NNTP-Posting-Host: cs2-15.con.ptd.net
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=ISO-8859-1
  12. X-Newsreader: WinVN 0.99.5
  13.  
  14. In article <4hdvuv$3vr@gryphon.phoenix.net>, brucew@phoenix.net says...
  15. >
  16. >In comp.lang.c
  17. >studwoof@ix.netcom.com(Studcat's Big Studdog.) wrote:
  18. >
  19. >>Hi.. I'm not a newbie.. I don't even use Gets(), fgets(), or scanf.. I
  20. >>use my own getstring function. My question is that everywhere I see
  21. >>that gets() is bad. Why exactly is it so bad? Could someone please
  22. >>explain in more detail than what the FAQ does? Thanks.
  23. >
  24. >It's really simple.  gets() gives you no control over the quanity
  25. >of chars input.  Without this control, there is ALWAYS the
  26. >possiblity of your array that stores the input being overrun.
  27. I am still sorta a newbie and I hate gets() for that reason. Could you 
  28. show me some code to write my own gets() function? It would be much 
  29. help.
  30.  
  31.